home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / bbs_soft / ppagemod.zip / PPE-PAGE.PPS < prev    next >
Text File  |  1993-05-17  |  12KB  |  308 lines

  1. ;*****************************************************************************
  2. ;*                                                                           *
  3. ;*                             PPE-PAGE v1.00b                               *
  4. ;*                  PCBOARD 15.0 OPERATOR PAGE PPE PROGRAM                   *
  5. ;*                                                                           *
  6. ;*                Written by Larry Steele and Jerry Claxton                  *
  7. ;*                 Written in PCBoard Programming Language                   *
  8. ;*                         Compiled on 05-03-1993                            *
  9. ;*                                                                           *
  10. ;*                     Modifications by Phillip J. White                     *
  11. ;*                         Modified on 05-16-1993                            *
  12. ;*                                                                           *
  13. ;*                   "The Shoppe Bulletin Board Systems"                     *
  14. ;*               Node 1 - 708-888-0725 - [16.8 DS] - 80486/50                *
  15. ;*               Node 2 - 708-888-1162 - [16.8 DS] - 80486/40                *
  16. ;*               Node 3 - 708-888-0078 - [16.8 DS] - 80486/40                *
  17. ;*               Node 4 - 708-888-4175 - [16.8 DS] - 80486/40                *
  18. ;*               Node 5 - PRIVATE LINE - [16.8 DS] - 80486/66                *
  19. ;*****************************************************************************
  20.  
  21.  
  22. ;*****************************************************************************
  23. ;* Define variable types                                                     *
  24. ;*****************************************************************************
  25.  
  26. INTEGER  DotCount, SecLowLevel, SecHighLevel, XColumn, YRow
  27. INTEGER  TotalUsers, Lp, AbortFlag, TotalReasons ;, SoundCount
  28.  
  29. STRING   PageConfigFile, PageTrashCanFile, PageWelcomeFile, PageCommentFile
  30. STRING   PageReasonFile, BadReasonFile
  31. STRING   BeginTimeString, EndingTimeString, PageDayString, TrashCanUser(250)
  32. STRING   RingSpeed, ReasonChat(250)
  33.  
  34. STRING   Answer, Reason, KeyPress, PageAmount
  35.  
  36. TIME     BeginTime, EndingTime, CurrentTime
  37.  
  38. ;*****************************************************************************
  39. ;* Parse out the configuration file from the command line.  Open the file so *
  40. ;* we can grab all the information needed to run the program.                *
  41. ;*****************************************************************************
  42.  
  43. ;GETTOKEN PageConfigFile
  44.  
  45. IF (EXIST(PPEPATH() + "PPE-PAGE.CNF") = 0) THEN
  46.      PRINTLN
  47.      PRINTLN "ERROR: File " + PageConfigFile + " not found!  Please nodify SysOp..."
  48.      PRINTLN
  49.      WAIT
  50.      END
  51. END IF
  52.  
  53. FOPEN 1, PPEPATH() + "PPE-PAGE.CNF", O_RD, S_DN
  54.   FGET 1, SecLowLevel
  55.   FGET 1, SecHighLevel
  56.   FGET 1, BeginTimeString
  57.   FGET 1, EndingTimeString
  58.   FGET 1, PageDayString
  59.   FGET 1, PageTrashCanFile
  60.   FGET 1, PageWelcomeFile
  61.   FGET 1, PageCommentFile
  62.   FGET 1, PageReasonFile
  63.   FGET 1, BadReasonFile
  64.   FGET 1, PageAmount
  65.   FGET 1, RingSpeed
  66. FCLOSE 1
  67.  
  68.  
  69. ;*****************************************************************************
  70. ;* Get Information from PCBOARD.SYS for this caller                          *
  71. ;* Write some information to the callerlog                                   *
  72. ;*****************************************************************************
  73.  
  74. GETUSER
  75. LOG U_NAME() + " (" + STRING(U_SEC) + ") SysOp Page at (" + LEFT(STRING(TIME()), 5) + ")", 0
  76.  
  77.  
  78. ;*****************************************************************************
  79. ;* Below we read the PCAN file for a list of users we DON'T won't to be able *
  80. ;* to page for the SysOp.                                                    *
  81. ;*****************************************************************************
  82.  
  83. IF (EXIST(PageTrashCanFile) > 0) THEN
  84.      FOPEN 1, PageTrashCanFile, O_RD, S_DN
  85.      FGET 1, TotalUsers
  86.  
  87.      FOR Lp = 1 TO TotalUsers
  88.           FGET 1, TrashCanUser(Lp)
  89.           IF (U_NAME() = UPPER(TrashCanUser(Lp))) GOTO WRONG_USER
  90.      NEXT Lp
  91.      FCLOSE 1
  92. END IF
  93.  
  94. ;*****************************************************************************
  95. ; Get the current system TIME                                                *
  96. ;                                                                            *
  97. ; If time is in HH:MM format adjust to HH:MM:SS or they won't work right     *
  98. ; then convert from STRING TIME to INTEGER TIME.                             *
  99. ;*****************************************************************************
  100.  
  101. CurrentTime = TIME()
  102.  
  103. IF (LEN(BeginTimeString) = 5) LET BeginTimeString = BeginTimeString + ":00"
  104. IF (LEN(EndingTimeString) = 5) LET EndingTimeString = EndingTimeString + ":00"
  105.  
  106. PageDayString = LEFT(PageDayString + "YYYYYYY", 7)
  107.  
  108. BeginTime = BeginTimeString
  109. EndingTime = EndingTimeString
  110.  
  111.  
  112. ;*****************************************************************************
  113. ; Check the users current security level against command line security level *
  114. ; Check to see if START TIME is before END TIME.                             *
  115. ;*****************************************************************************
  116.  
  117. IF (U_SEC < SecLowLevel | U_SEC > SecHighLevel) GOTO WRONG_SECURITY
  118.  
  119. IF ((BeginTime <= EndingTime) & (BeginTime <> 0) & (EndingTime <> 0)) THEN
  120.    IF (CurrentTime < BeginTime | CurrentTime > EndingTime) GOTO WRONG_TIMES
  121. ELSE
  122.    IF (CurrentTime < BeginTime & CurrentTime > EndingTime) GOTO WRONG_TIMES
  123. END IF
  124.  
  125. IF (UPPER(MID(PageDayString, DOW(DATE()) + 1, 1)) = "N") GOTO WRONG_DAY
  126.  
  127. ;*****************************************************************************
  128. ; Start of Main PPE-PAGE.PPE                                                  *
  129. ;*****************************************************************************
  130.  
  131. CLS
  132. IF (EXIST(PageWelcomeFile)) THEN
  133.     DISPFILE PageWelcomeFile, LANG + SEC + GRAPH
  134. ELSE
  135.     PRINTLN "@X70┌────────────────────────────────────────────────────────────────────────────@X7F┐@X07"
  136.     PRINTLN "@X70│ @X75* @X74PCBOARD @X75*     @X70==@X71 O  P  E  R  A  T  O  R    P  A  G  E @X70==     @X75* @X74PCBOARD @X75* @X7F│@X07"
  137.     PRINTLN "@X70└@X7F────────────────────────────────────────────────────────────────────────────┘@X07"
  138. END IF
  139.  
  140. PRINTLN
  141. INPUTTEXT "Why do you want to page the SysOp", Reason, 0Eh, 43
  142. IF (EXIST(PageReasonFile) > 0) THEN
  143.      FOPEN 1, PageReasonFile, O_RD, S_DN
  144.      FGET 1, TotalReasons
  145.  
  146.      FOR Lp = 1 TO TotalReasons
  147.           FGET 1, ReasonChat(Lp)
  148.           IF (Reason = UPPER(ReasonChat(Lp))) GOTO BADREASON
  149.        IF (Reason = LOWER(ReasonChat(Lp))) GOTO BADREASON
  150.           IF (Reason = ReasonChat(Lp)) GOTO BADREASON
  151.      NEXT Lp
  152.      FCLOSE 1
  153. IF ((Reason = "") | (LEN(Reason) <= 3)) GOTO ABORT_PAGE
  154. IF (Reason <> "") GOSUB DISPLAY_BBSSIDE
  155.  
  156. END IF
  157.  
  158. LOG "Reason: " + Reason, 0
  159.  
  160. CurrentTime = TIME()
  161. NEWLINES 2
  162. PRINT "@X0EPage ends in "+ PageAmount +" seconds. @X0C(@X0ECtrl-K@X0C) @X0EAborts @X0F."
  163. WHILE ((CurrentTime + PageAmount) > TIME()) DO
  164.      AbortFlag = (ABORT())
  165.      IF (AbortFlag) GOTO USER_ABORT_PAGE
  166.            
  167.      KeyPress = KINKEY()
  168.      IF (KeyPress = CHR(32)) GOTO SYSOP_CHAT
  169.  
  170.      DotCount = DotCount + 1
  171.      IF ((DotCount % RingSpeed) == 0) THEN
  172.           PRINT "@X0F."
  173. ;          SoundCount = SoundCount + 1
  174. ;          IF ((SoundCount % 2) == 0) THEN
  175.                PRINT "@X09."
  176.                SOUND (1100)
  177.                DELAY (8)
  178.                SOUND (800)
  179.                DELAY (6)
  180. ;          END IF
  181.           SOUND (0)
  182.      END IF
  183. ENDWHILE
  184.  
  185. IF (PAGESTAT() = 0) PAGEON
  186. GOTO NOT_HOME
  187.  
  188. ;*****************************************************************************
  189. ; End of Main PPE-PAGE.PPE                                                    *
  190. ;*****************************************************************************
  191. END
  192.  
  193. ;*****************************************************************************
  194. ; This is all the GOTO and GOSUB LABELS                                      *
  195. ;*****************************************************************************
  196.  
  197.  
  198. :DISPLAY_BBSSIDE
  199.      WRUNET PCBNODE(), "Paging SysOp", U_NAME(), U_CITY, "", ""
  200.      XColumn = GETX()
  201.      YRow = GETY()
  202.      ANSIPOS 1, 1
  203.  
  204.      COLOR 63
  205.      SPRINTLN "┌────────────────────────────────────────────────────────────────────────────┐"
  206.      SPRINTLN "│ [SysOp] - Press (SPACE) to acknowledge Operator Page, (ESC) when finished. │"
  207.      SPRINTLN "└────────────────────────────────────────────────────────────────────────────┘"
  208.  
  209.      COLOR DEFCOLOR()
  210.      ANSIPOS XColumn, YRow
  211.      RETURN
  212.  
  213.  
  214. :NOT_HOME
  215.      NEWLINES 2
  216.      IF (EXIST(PageCommentFile)) THEN
  217.          DISPFILE PageCommentFile, LANG + SEC + GRAPH
  218.      ELSE
  219.          PRINTLN "@X0CSorry, the Sysop is not currently available for CHAT!"
  220.      END IF
  221.      GOTO PROMPT_USER
  222.  
  223.  
  224. :WRONG_USER
  225.      FCLOSE 1
  226.      PRINTLN
  227.      PRINTLN "@X0CSorry, the Sysop is not currently available for CHAT!"
  228.      GOTO PROMPT_USER
  229.  
  230.  
  231. :WRONG_SECURITY
  232.      PRINTLN
  233.      PRINTLN "@X0ESorry, insufficient Security to page for SysOp!"
  234.      GOTO PROMPT_USER
  235.  
  236.  
  237. :WRONG_TIMES
  238.      PRINTLN
  239.      PRINTLN "@X70┌────────────────────────────────────────────────────────────────────────────@X7F┐@X07"
  240.      PRINTLN "@X70│ @X71Sorry, @FIRST@, you may only PAGE for the SysOp in the HOURS listed below:@POS:78@@X7F│@X07"
  241.      PRINTLN "@X70└@X7F────────────────────────────────────────────────────────────────────────────┘@X07"
  242.      PRINTLN
  243.      PRINTLN "@X70┌────────────────────────────────────────────────────────────────────────────@X7F┐@X07"
  244.      PRINTLN "@X70│ @X74Beginning Time: @X7E" + STRING(BeginTime) + " am                       @X74Ending Time: @X7E" + STRING(EndingTime) + " pm @X7F│@X07"
  245.      PRINTLN "@X70└@X7F────────────────────────────────────────────────────────────────────────────┘@X07"
  246.      GOTO PROMPT_USER
  247.  
  248.  
  249. :WRONG_DAY
  250.      PRINTLN
  251.      PRINTLN "@X70┌────────────────────────────────────────────────────────────────────────────@X7F┐@X07"
  252.      PRINTLN "@X70│ @X71Sorry, @FIRST@, you may only PAGE for the SysOp in the DAYS listed below: @POS:78@@X7F│@X07"
  253.      PRINTLN "@X70└@X7F────────────────────────────────────────────────────────────────────────────┘@X07"
  254.      PRINTLN
  255.      PRINTLN "@X07@X70┌────────────────────────────────────────────────────────────────────────────@X7F┐@X07"
  256.      PRINTLN "@X70│  @X74SUN@X70=@X71" + MID(PageDayString, 1, 1) + "      @X74MON@X70=@X71" + MID(PageDayString, 2, 1) + "      @X74TUE@X70=@X71" + MID(PageDayString, 3, 1) + "      @X74WED@X70=@X71" + MID(PageDayString, 4, 1) + "      @X74THU@X70=@X71" + MID(PageDayString, 5, 1) + "      @X74FRI@X70=@X71" + MID(PageDayString, 6, 1) + "      @X74SAT@X70=@X71" + MID(PageDayString, 7, 1) + "   @X7F│@X07"
  257.      PRINTLN "@X70└@X7F────────────────────────────────────────────────────────────────────────────┘@X07"
  258.      GOTO PROMPT_USER
  259.  
  260.  
  261. :PROMPT_USER
  262.      PRINTLN
  263.      INPUTYN "Would you like to leave a comment to the Sysop instead Y/N", Answer, 0Ah
  264.      IF (Answer <> YESCHAR()) STOP
  265.  
  266.      KBDSTUFF "C" + CHR(13) + "Y" + CHR(13)
  267.      END
  268.  
  269.  
  270. :SYSOP_CHAT
  271.      CHAT
  272.      END
  273.  
  274.  
  275. :BADREASON
  276.  
  277.      CLS
  278.      IF (EXIST(BadReasonFile)) THEN
  279.      DISPFILE BadReasonFile, LANG + SEC + GRAPH
  280.  
  281. ELSE
  282.  
  283. PRINTLN CHR(07)+CHR(07)+CHR(07)
  284.  
  285. PRINTLN "@X40┌─────────────────────────────────────────────────────────────────────────────@X4C┐@X07"
  286. PRINTLN "@X40│              @X4EThe Reason you gave for paging the SysOp is NOT                @X4C│@X07"
  287. PRINTLN "@X40│              @X4EAcceptable!                                                    @X4C│@X07"
  288. PRINTLN "@X40│                                                                 @X4C            │@X07"
  289. PRINTLN "@X40│                              @X40PAGE ABORTED...                                @X4C│@X07"
  290. PRINTLN "@X40│                                                                             @X4C│@X07"
  291. PRINTLN "@X40└@X4C─────────────────────────────────────────────────────────────────────────────┘@X07"
  292.  
  293. END IF
  294.  
  295. PRINTLN
  296.      END
  297.  
  298. :ABORT_PAGE
  299.      END
  300.  
  301.  
  302. :USER_ABORT_PAGE
  303.      RESETDISP
  304.      IF (PAGESTAT() = 0) PAGEON
  305.  
  306.      NEWLINES 1
  307.      END
  308.